#!/bin/bash

# 定义变量
SOURCE_FILE="AppPlatformJNI.cpp"
OUTPUT_LIB="libappplatformjni.so"
TARGET_DIR="/usr/users/e3000/appuse/application/bin/native/"
PLATFORMSDK_LIB="/usr/users/e3000/appuse/platformsdk/lib/"


# 编译源文件
echo "compiling $SOURCE_FILE ..."
g++ -std=c++11 \
    -I"$JAVA_HOME/include" \
    -I"$JAVA_HOME/include/linux" \
    -fPIC \
    -shared \
    -o "$OUTPUT_LIB" \
    "$SOURCE_FILE" \
    -L"$PLATFORMSDK_LIB" \
    -lappplatform

echo "compile success,file:$OUTPUT_LIB"

cp "$OUTPUT_LIB" "$TARGET_DIR"

echo "copy file success"